Skip to content

fix(ci): update .main.commit for non-dev mcore branches - #3214

Merged
ko3n1g merged 1 commit into
r0.4.0from
ko3n1g/fix/update-main-commit-release-branches-r0.4.0
Apr 8, 2026
Merged

fix(ci): update .main.commit for non-dev mcore branches#3214
ko3n1g merged 1 commit into
r0.4.0from
ko3n1g/fix/update-main-commit-release-branches-r0.4.0

Conversation

@ko3n1g

@ko3n1g ko3n1g commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #3213 to r0.4.0.

  • When bumping on release branches (e.g. r0.4.0 with mcore-branch=mcore-core_r0.17.0), the mcore-branch input matches neither "main" nor "dev", so .main.commit was never written
  • The unit test test_main_commit_matches_submodule then fails because the bumped submodule commit no longer matches .main.commit — as seen in chore(beep boop 🤖): Bump uv.lock (r0.4.0, mcore-core_r0.17.0) (2026-04-07) #3191
  • Fix: write .main.commit for all non-dev branches (covers both main and release branches)

Test plan

  • Verify test_main_commit_matches_submodule passes on next bump run for r0.4.0

Summary by CodeRabbit

  • Chores
    • Improved dependency update workflow to ensure all branches receive consistent commit tracking, streamlining automated dependency management across the entire workflow.

When bumping on release branches (e.g. r0.4.0 with mcore-core_r0.17.0),
the mcore-branch input matches neither "main" nor "dev", so .main.commit
was never written. The unit test test_main_commit_matches_submodule then
fails because the submodule no longer matches .main.commit.

Fix: write .main.commit for all non-dev branches (main + release branches).
Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g
ko3n1g requested a review from a team as a code owner April 8, 2026 09:12
@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Modified a GitHub Actions workflow step to change how commit marker files are written based on branch. Now writes .dev.commit for dev branch and .main.commit for all other branches, whereas previously it explicitly handled only main and dev.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/_update_dependencies.yml
Updated conditional logic for writing branch-specific commit marker files: .dev.commit for dev branch and .main.commit for all other branch values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: writing .main.commit for non-dev branches in the CI workflow, which is the core fix addressing the reported issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Test Results For Major Changes ✅ Passed Minor bug fix to GitHub Actions workflow (3 lines changed) correcting commit markers on non-dev branches, with test plan referencing test_main_commit_matches_submodule.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ko3n1g/fix/update-main-commit-release-branches-r0.4.0

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/_update_dependencies.yml (1)

74-76: Consider renaming the local TARGET_BRANCH to avoid shadowing.

The TARGET_BRANCH env var here refers to inputs.mcore-branch, but there's already a TARGET_BRANCH defined at line 43 referring to inputs.target-branch. While shell scoping keeps these separate per step, the reuse is potentially confusing for future maintainers.

♻️ Suggested rename for clarity
      - name: Update submodules
        id: mlm-commit
        env:
-         TARGET_BRANCH: ${{ inputs.mcore-branch }}
+         MCORE_BRANCH: ${{ inputs.mcore-branch }}
        run: |
          pushd 3rdparty/Megatron-LM
            git fetch origin ${{ inputs.mcore-branch }}
            git checkout FETCH_HEAD
            MLM_COMMIT=$(git rev-parse HEAD)
          popd

-         if [[ "$TARGET_BRANCH" == "dev" ]]; then
+         if [[ "$MCORE_BRANCH" == "dev" ]]; then
            echo $MLM_COMMIT > .dev.commit
          else
            echo $MLM_COMMIT > .main.commit
          fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/_update_dependencies.yml around lines 74 - 76, The step
defines env TARGET_BRANCH = inputs.mcore-branch which shadows the earlier
TARGET_BRANCH = inputs.target-branch; rename the local variable (e.g.,
MCORE_TARGET_BRANCH or MC_TARGET_BRANCH) in this step's env and update any
downstream uses in that step to reference the new name so it's clear this is the
mcore branch and not the global TARGET_BRANCH; ensure you change occurrences of
TARGET_BRANCH inside this step (and any subsequent step-scoped references) to
the new symbol while leaving the original inputs.target-branch binding
untouched.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/_update_dependencies.yml:
- Around line 74-76: The step defines env TARGET_BRANCH = inputs.mcore-branch
which shadows the earlier TARGET_BRANCH = inputs.target-branch; rename the local
variable (e.g., MCORE_TARGET_BRANCH or MC_TARGET_BRANCH) in this step's env and
update any downstream uses in that step to reference the new name so it's clear
this is the mcore branch and not the global TARGET_BRANCH; ensure you change
occurrences of TARGET_BRANCH inside this step (and any subsequent step-scoped
references) to the new symbol while leaving the original inputs.target-branch
binding untouched.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6a2bf504-1a82-448b-ae76-4f72e5416f63

📥 Commits

Reviewing files that changed from the base of the PR and between 2be3464 and e5d4f21.

📒 Files selected for processing (1)
  • .github/workflows/_update_dependencies.yml

@ko3n1g
ko3n1g enabled auto-merge (squash) April 8, 2026 11:15
@ko3n1g
ko3n1g disabled auto-merge April 8, 2026 13:58
@ko3n1g
ko3n1g merged commit 4c66912 into r0.4.0 Apr 8, 2026
52 checks passed
@ko3n1g
ko3n1g deleted the ko3n1g/fix/update-main-commit-release-branches-r0.4.0 branch April 8, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants